import volley.Person
import volley.Authority

class BootStrap {

    def fixtureLoader

    def authenticateService

    def init = { servletContext ->

        environments {
            test {
            }
            development {
                loadData()
            }
        }

    }
    def destroy = {
    }

    void loadData() {
        final def adminPassword = authenticateService.encodePassword('lc541116')
        fixtureLoader.load('init')

        fixtureLoader.load {

            'person_Admin'(Person) {
                username = 'admin'
                userRealName = 'Administrator'
                passwd = adminPassword
                enabled = true
            }

            roleAdmin(Authority) {
                authority = 'ADMIN'
                description = '系统管理员'
                people = [person_Admin]
            }
        }

    }
} 